home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_vol_lavacragambient.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  132 lines

  1. # Jones 3D Cog Script
  2. #
  3. # VOL_LavaCragAmbient.cog
  4. #
  5. # Produces random ambient cave sounds when crossing adjoins
  6. # Based on code from TEO_Drops.cog by SXC.
  7. #
  8. # [TRM & SXC]  modified 12/3 by [CMG]
  9. #
  10. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.  
  16.     #................MESSAGES........................
  17.     message     startup
  18.     message     crossed
  19.     message     pulse
  20.     
  21.     #................ACTORS..........................
  22.     
  23.     thing        player                                local
  24.     
  25.     
  26.     #................TRIGGERS........................
  27.     surface       oncross               linkID=2
  28.     surface       oncross1              linkID=2
  29.  
  30.     
  31.     
  32.     surface       offcross              linkID=3
  33.     surface       offcross1             linkID=3
  34.  
  35.     
  36.             
  37.     #................SOUNDS........................
  38.     sound       sndCave0=gen_amb_eerie_03.wav        local
  39.     sound       sndCave1=olv_outside_a03.wav        local
  40.     sound       sndCave2=gen_lava_bloop_a.wav        local
  41.     sound       sndCave3=gen_cave_a2.wav              local
  42.     sound       sndCave4=gen_lava_blurp_a.wav          local
  43.     sound       sndCave5=gen_sg_squawk.wav            local
  44.         
  45.     #................VARIABLES........................
  46.     
  47.     float       caveFreq                            local
  48.     
  49.     flex        pulseTime                            local
  50.     flex        vol=1.0                                local
  51.     
  52. end
  53.  
  54. # ========================================================================================
  55.  
  56. code
  57.  
  58. startup:
  59.  
  60.     player = GetLocalPlayerThing();
  61.  
  62. return;
  63.  
  64.  
  65. # ========================================================================================
  66. crossed:
  67.  
  68.     If ((GetSenderID() == 2) && (GetSourceref() == player))
  69.             {
  70.             pulseTime=RandBetween(4, 12);
  71.             SetPulse(pulseTime);
  72.             #print("starting shark cave sound");
  73.             }
  74.     
  75.     If ((GetSenderID() == 3) && (GetSourceref() == player))
  76.             {
  77.             SetPulse(0);
  78.             #print("stopping shark cave sound");
  79.             }
  80.  
  81. return;
  82. # ========================================================================================
  83. pulse:
  84.  
  85.         #print("soundcheck");
  86.         pulseTime=RandBetween(4, 8);
  87.         SetPulse(pulseTime);
  88.  
  89.     
  90.         # check if indy is swimming, if so set the pelsu then drop out
  91.         if (GetMoveStatus(player) == 12) return;
  92.     
  93.  
  94.     caveFreq = Rand();
  95.  
  96.     if (caveFreq < 0.16)
  97.         {
  98.             PlaySoundLocal(sndCave0, vol, 1, 0, 0);
  99.         }
  100.         
  101.     if ((caveFreq > 0.16) && (caveFreq < 0.32))
  102.         {
  103.             PlaySoundLocal(sndCave1, vol, 1, 0, 0);
  104.         }
  105.         
  106.     if ((caveFreq > 0.32) && (caveFreq < 0.48))
  107.         {
  108.             PlaySoundLocal(sndCave2, 0.25, -1, 0, 0);
  109.         }
  110.     
  111.     if ((caveFreq > 0.48) && (caveFreq < 0.64))
  112.         {
  113.             PlaySoundLocal(sndCave3, vol, 1, 0, 0);
  114.         }
  115.     
  116.     if ((caveFreq > 0.64) && (caveFreq < 0.80))
  117.         {
  118.             PlaySoundLocal(sndCave4, 0.25, 0, 0, 0);
  119.         }
  120.     
  121.     if ((caveFreq > 0.80) && (caveFreq < 0.96))
  122.         {
  123.             PlaySoundLocal(sndCave5, 0.1, -1, 0, 0);
  124.         }
  125.         
  126.         return;
  127.     
  128. return;
  129. # ========================================================================================
  130.         
  131. end
  132.